package com.atmc.controller;

import com.atmc.bean.User;
import com.atmc.service.FeignService;
import com.atmc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@Controller
public class FeignController {

    @Autowired
    FeignService feignService;
    public static final String url="http://localhost:9001";
    @RequestMapping("/consumer/nacos")
    @ResponseBody
    public String openFeign(){
        String nacos = feignService.nacos();
        return nacos;
    }
    @RequestMapping("/consumer/selectAll")
    @ResponseBody
    public List<User> select(){
        List<User> select = feignService.select();
        return select;
    }

}
